//package com.hua.config;
//
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
////可实现拦截
//public class MyInterceptor implements HandlerInterceptor{
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        if(request.getSession().getAttribute("user")!=null){
//            return true;
//        }else {
//            request.setAttribute("msg","请先登录");
//            request.getRequestDispatcher("/backend/page/login/login.html").forward(request,response);
//            return false;
//        }
//    }
//}
